﻿using EF6WithSqlDemo.Model;
using System.Data.Entity;

namespace EF6WithSqlDemo
{
    internal class BloggingContext : DbContext
    {
        public DbSet<Blog> Blogs { get; set; }
        public DbSet<Post> Posts { get; set; }

        static BloggingContext()
        {
   
        }


        public BloggingContext(): this("sqlconn")
        {

        }

        public BloggingContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {
            //禁用延迟加载
            //this.Configuration.LazyLoadingEnabled = false;
            //禁用代理
            //this.Configuration.ProxyCreationEnabled = false;
        }

        protected override void OnModelCreating(DbModelBuilder builder)
        {
            base.OnModelCreating(builder);
        }
    }
}